The main GDK thread lock is not portable and deprecated.
The only reason why gdk_threads_add_timeout() and
gdk_threads_add_timeout_full() exist is to allow invoking a callback
with the GDK lock held, in case 3rd party libraries still use the
deprecated gdk_threads_enter()/gdk_threads_leave() API.
Since we're removing the GDK lock, and we're releasing a new major API,
such code cannot exist any more; this means we can use the GLib API for
installing timeout callbacks.
https://bugzilla.gnome.org/show_bug.cgi?id=793124
* The timeout simply simulates a slow data source by inserting
* pauses in the reading process.
*/
- load_timeout = gdk_threads_add_timeout (150,
- progressive_timeout,
- image);
+ load_timeout = g_timeout_add (150, progressive_timeout, image);
g_source_set_name_by_id (load_timeout, "[gtk+] progressive_timeout");
}
if (priv->flush_idle_id == 0 && RUN_FLUSH_IDLE (priv))
{
- priv->flush_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_EVENTS + 1,
- min_interval,
- gdk_frame_clock_flush_idle,
- g_object_ref (clock_idle),
- (GDestroyNotify) g_object_unref);
+ priv->flush_idle_id = g_timeout_add_full (GDK_PRIORITY_EVENTS + 1,
+ min_interval,
+ gdk_frame_clock_flush_idle,
+ g_object_ref (clock_idle),
+ (GDestroyNotify) g_object_unref);
g_source_set_name_by_id (priv->flush_idle_id, "[gtk+] gdk_frame_clock_flush_idle");
}
if (!priv->in_paint_idle &&
priv->paint_idle_id == 0 && RUN_PAINT_IDLE (priv))
{
- priv->paint_idle_id = gdk_threads_add_timeout_full (GDK_PRIORITY_REDRAW,
- min_interval,
- gdk_frame_clock_paint_idle,
- g_object_ref (clock_idle),
- (GDestroyNotify) g_object_unref);
+ priv->paint_idle_id = g_timeout_add_full (GDK_PRIORITY_REDRAW,
+ min_interval,
+ gdk_frame_clock_paint_idle,
+ g_object_ref (clock_idle),
+ (GDestroyNotify) g_object_unref);
g_source_set_name_by_id (priv->paint_idle_id, "[gtk+] gdk_frame_clock_paint_idle");
}
}
/* We are likely not getting precisely even callbacks in real
* time, particularly if the event loop is busy.
* This is a documented limitation in the precision of
- * gdk_threads_add_timeout_full and g_timeout_add_full.
+ * g_timeout_add_full().
*
* In order to avoid this imprecision from compounding between
* frames and affecting visual smoothness, we correct frame_time
timeout = (seat->repeat_deadline - now) / 1000L;
- seat->repeat_timer =
- gdk_threads_add_timeout (timeout, keyboard_repeat, seat);
+ seat->repeat_timer = g_timeout_add (timeout, keyboard_repeat, seat);
g_source_set_name_by_id (seat->repeat_timer, "[gtk+] keyboard_repeat");
}
anim->frame_clock = gdk_window_get_frame_clock (win32_context->drag_window);
anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
- id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
- gdk_drag_anim_timeout, anim,
- (GDestroyNotify) gdk_drag_anim_destroy);
+ id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
+ gdk_drag_anim_timeout, anim,
+ (GDestroyNotify) gdk_drag_anim_destroy);
g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
}
if (win32_sel->clipboard_opened_for == INVALID_HANDLE_VALUE &&
clipboard_queue == NULL)
{
- id = gdk_threads_add_timeout_seconds (1, (GSourceFunc) open_clipboard_timeout, NULL);
+ id = g_timeout_add_seconds (1, (GSourceFunc) open_clipboard_timeout, NULL);
g_source_set_name_by_id (id, "[gdk-win32] open_clipboard_timeout");
GDK_NOTE (DND, g_print ("Started open clipboard timer\n"));
}
anim->frame_clock = gdk_window_get_frame_clock (x11_context->drag_window);
anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
- id = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT, 17,
- gdk_drag_anim_timeout, anim,
- (GDestroyNotify) gdk_drag_anim_destroy);
+ id = g_timeout_add_full (G_PRIORITY_DEFAULT, 17,
+ gdk_drag_anim_timeout, anim,
+ (GDestroyNotify) gdk_drag_anim_destroy);
g_source_set_name_by_id (id, "[gtk+] gdk_drag_anim_timeout");
}
priv->grab_keyboard = device;
}
- priv->activate_timeout = gdk_threads_add_timeout (ACTIVATE_TIMEOUT,
- button_activate_timeout,
- button);
+ priv->activate_timeout = g_timeout_add (ACTIVATE_TIMEOUT, button_activate_timeout, button);
g_source_set_name_by_id (priv->activate_timeout, "[gtk+] button_activate_timeout");
priv->button_down = TRUE;
gtk_button_update_state (button);
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+ priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
(GSourceFunc) calendar_timer,
- (gpointer) calendar, NULL);
+ calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
}
else
if (!priv->timer)
{
priv->need_timer = TRUE;
- priv->timer = gdk_threads_add_timeout_full (G_PRIORITY_DEFAULT_IDLE,
+ priv->timer = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
TIMEOUT_INITIAL,
(GSourceFunc) calendar_timer,
- (gpointer) calendar, NULL);
+ calendar, NULL);
g_source_set_name_by_id (priv->timer, "[gtk+] calendar_timer");
}
}
if (priv->entry_menu_popdown_timeout)
return;
- priv->entry_menu_popdown_timeout = gdk_threads_add_timeout (500, popdown_timeout,
- data);
+ priv->entry_menu_popdown_timeout = g_timeout_add (500, popdown_timeout, data);
g_source_set_name_by_id (priv->entry_menu_popdown_timeout, "[gtk+] popdown_timeout");
}
if (info->icon_window)
gtk_widget_hide (info->icon_window);
- info->drop_timeout = gdk_threads_add_timeout (DROP_ABORT_TIME,
- gtk_drag_abort_timeout,
- info);
+ info->drop_timeout = g_timeout_add (DROP_ABORT_TIME, gtk_drag_abort_timeout, info);
g_source_set_name_by_id (info->drop_timeout, "[gtk+] gtk_drag_abort_timeout");
}
password_hint->position = position;
if (password_hint->source_id)
g_source_remove (password_hint->source_id);
- password_hint->source_id = gdk_threads_add_timeout (password_hint_timeout,
- (GSourceFunc)gtk_entry_remove_password_hint, entry);
+ password_hint->source_id = g_timeout_add (password_hint_timeout,
+ (GSourceFunc)gtk_entry_remove_password_hint,
+ entry);
g_source_set_name_by_id (password_hint->source_id, "[gtk+] gtk_entry_remove_password_hint");
}
}
g_source_remove (priv->selection_bubble_timeout_id);
priv->selection_bubble_timeout_id =
- gdk_threads_add_timeout (50, gtk_entry_selection_bubble_popup_show, entry);
+ g_timeout_add (50, gtk_entry_selection_bubble_popup_show, entry);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_entry_selection_bubble_popup_cb");
}
else if (priv->cursor_visible)
{
hide_cursor (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
show_cursor (entry);
priv->blink_time += get_cursor_time (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
if (!priv->blink_timeout)
{
show_cursor (entry);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
if (priv->blink_timeout != 0)
g_source_remove (priv->blink_timeout);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- entry);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (entry) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ entry);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
show_cursor (entry);
}
completion->priv->device = device;
completion->priv->completion_timeout =
- gdk_threads_add_timeout (COMPLETION_TIMEOUT,
+ g_timeout_add (COMPLETION_TIMEOUT,
gtk_entry_completion_timeout,
completion);
g_source_set_name_by_id (completion->priv->completion_timeout, "[gtk+] gtk_entry_completion_timeout");
if (!priv->expanded && !priv->expand_timer)
{
- priv->expand_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
+ priv->expand_timer = g_timeout_add (TIMEOUT_EXPAND, (GSourceFunc) expand_timeout, expander);
g_source_set_name_by_id (priv->expand_timer, "[gtk+] expand_timeout");
}
g_assert (priv->load_timeout_id == 0);
g_assert (priv->load_state != LOAD_PRELOAD);
- priv->load_timeout_id = gdk_threads_add_timeout (MAX_LOADING_TIME, load_timeout_cb, impl);
+ priv->load_timeout_id = g_timeout_add (MAX_LOADING_TIME, load_timeout_cb, impl);
g_source_set_name_by_id (priv->load_timeout_id, "[gtk+] load_timeout_cb");
priv->load_state = LOAD_PRELOAD;
}
if (model->dir_thaw_source == 0)
{
freeze_updates (model);
- model->dir_thaw_source = gdk_threads_add_timeout_full (IO_PRIORITY + 1,
- 50,
- thaw_func,
- model,
- NULL);
+ model->dir_thaw_source = g_timeout_add_full (IO_PRIORITY + 1, 50,
+ thaw_func,
+ model,
+ NULL);
g_source_set_name_by_id (model->dir_thaw_source, "[gtk+] thaw_func");
}
gtk_gesture_get_point (gesture, sequence,
&priv->initial_x, &priv->initial_y);
- priv->timeout_id = gdk_threads_add_timeout (delay, _gtk_gesture_long_press_timeout, gesture);
+ priv->timeout_id = g_timeout_add (delay, _gtk_gesture_long_press_timeout, gesture);
g_source_set_name_by_id (priv->timeout_id, "[gtk+] _gtk_gesture_long_press_timeout");
}
settings = gtk_widget_get_settings (widget);
g_object_get (settings, "gtk-double-click-time", &double_click_time, NULL);
- priv->double_click_timeout_id = gdk_threads_add_timeout (double_click_time,
- _double_click_timeout_cb,
- gesture);
+ priv->double_click_timeout_id = g_timeout_add (double_click_time, _double_click_timeout_cb, gesture);
g_source_set_name_by_id (priv->double_click_timeout_id, "[gtk+] _double_click_timeout_cb");
}
icon_view->priv->event_last_y = icon_view->priv->mouse_x;
if (icon_view->priv->scroll_timeout_id == 0) {
- icon_view->priv->scroll_timeout_id = gdk_threads_add_timeout (30, rubberband_scroll_timeout,
- icon_view);
+ icon_view->priv->scroll_timeout_id = g_timeout_add (30, rubberband_scroll_timeout, icon_view);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] rubberband_scroll_timeout");
}
}
{
if (icon_view->priv->scroll_timeout_id == 0)
{
- icon_view->priv->scroll_timeout_id =
- gdk_threads_add_timeout (50, drag_scroll_timeout, icon_view);
+ icon_view->priv->scroll_timeout_id = g_timeout_add (50, drag_scroll_timeout, icon_view);
g_source_set_name_by_id (icon_view->priv->scroll_timeout_id, "[gtk+] drag_scroll_timeout");
}
? -MENU_SCROLL_STEP2
: -MENU_SCROLL_STEP1;
- priv->scroll_timeout =
- gdk_threads_add_timeout (scroll_fast
- ? MENU_SCROLL_TIMEOUT2
- : MENU_SCROLL_TIMEOUT1,
- gtk_menu_scroll_timeout, menu);
+ priv->scroll_timeout = g_timeout_add (scroll_fast
+ ? MENU_SCROLL_TIMEOUT2
+ : MENU_SCROLL_TIMEOUT1,
+ gtk_menu_scroll_timeout,
+ menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
}
else if (!enter && !in_arrow && priv->upper_arrow_prelight)
? MENU_SCROLL_STEP2
: MENU_SCROLL_STEP1;
- priv->scroll_timeout =
- gdk_threads_add_timeout (scroll_fast
- ? MENU_SCROLL_TIMEOUT2
- : MENU_SCROLL_TIMEOUT1,
- gtk_menu_scroll_timeout, menu);
+ priv->scroll_timeout = g_timeout_add (scroll_fast
+ ? MENU_SCROLL_TIMEOUT2
+ : MENU_SCROLL_TIMEOUT1,
+ gtk_menu_scroll_timeout,
+ menu);
g_source_set_name_by_id (priv->scroll_timeout, "[gtk+] gtk_menu_scroll_timeout");
}
else if (!enter && !in_arrow && priv->lower_arrow_prelight)
info->menu_item = menu_item;
info->trigger_event = gtk_get_current_event ();
- priv->timer = gdk_threads_add_timeout (popup_delay,
- gtk_menu_item_popup_timeout,
- info);
+ priv->timer = g_timeout_add (popup_delay, gtk_menu_item_popup_timeout, info);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_menu_item_popup_timeout");
return;
if (!priv->dnd_timer)
{
priv->has_scrolled = TRUE;
- priv->dnd_timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+ priv->dnd_timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
scroll_notebook_timer,
- (gpointer) notebook);
+ notebook);
g_source_set_name_by_id (priv->dnd_timer, "[gtk+] scroll_notebook_timer");
}
}
if (!priv->switch_tab_timer)
{
- priv->switch_tab_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
- gtk_notebook_switch_tab_timeout,
- widget);
+ priv->switch_tab_timer = g_timeout_add (TIMEOUT_EXPAND, gtk_notebook_switch_tab_timeout, widget);
g_source_set_name_by_id (priv->switch_tab_timer, "[gtk+] gtk_notebook_switch_tab_timeout");
}
}
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
+ priv->timer = g_timeout_add (TIMEOUT_REPEAT * SCROLL_DELAY_FACTOR,
+ (GSourceFunc) gtk_notebook_timer,
+ notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
}
else
if (!priv->timer)
{
- priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
- (GSourceFunc) gtk_notebook_timer,
- (gpointer) notebook);
+ priv->timer = g_timeout_add (TIMEOUT_INITIAL,
+ (GSourceFunc) gtk_notebook_timer,
+ notebook);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_notebook_timer");
priv->need_timer = TRUE;
}
win32_poll_status (op);
if (!gtk_print_operation_is_finished (op)) {
- op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+ op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
{
op_win32->printerHandle = printerHandle;
win32_poll_status (op);
- op_win32->timeout_id = gdk_threads_add_timeout (STATUS_POLLING_TIME,
+ op_win32->timeout_id = g_timeout_add (STATUS_POLLING_TIME,
(GSourceFunc)win32_poll_status_timeout,
op);
g_source_set_name_by_id (op_win32->timeout_id, "[gtk+] win32_poll_status_timeout");
G_CALLBACK (handle_progress_response), op);
priv->show_progress_timeout_id =
- gdk_threads_add_timeout (SHOW_PROGRESS_TIME,
- (GSourceFunc)show_progress_timeout,
- data);
+ g_timeout_add (SHOW_PROGRESS_TIME,
+ (GSourceFunc) show_progress_timeout,
+ data);
g_source_set_name_by_id (priv->show_progress_timeout_id, "[gtk+] show_progress_timeout");
data->progress = progress;
GtkRange *range = GTK_RANGE (data);
GtkRangePrivate *priv = range->priv;
- priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_REPEAT,
- second_timeout,
- range);
+ priv->timer->timeout_id = g_timeout_add (TIMEOUT_REPEAT, second_timeout, range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] second_timeout");
return G_SOURCE_REMOVE;
}
priv->timer = g_new (GtkRangeStepTimer, 1);
- priv->timer->timeout_id = gdk_threads_add_timeout (TIMEOUT_INITIAL,
- initial_timeout,
- range);
+ priv->timer->timeout_id = g_timeout_add (TIMEOUT_INITIAL, initial_timeout, range);
g_source_set_name_by_id (priv->timer->timeout_id, "[gtk+] initial_timeout");
priv->timer->step = step;
*/
if (manager->priv->changed_timeout == 0)
{
- manager->priv->changed_timeout = gdk_threads_add_timeout (250, emit_manager_changed, manager);
+ manager->priv->changed_timeout = g_timeout_add (250, emit_manager_changed, manager);
g_source_set_name_by_id (manager->priv->changed_timeout, "[gtk+] emit_manager_changed");
}
else
indicator_set_over (indicator, TRUE);
else if (indicator_close && !on_other_scrollbar)
{
- indicator->over_timeout_id = gdk_threads_add_timeout (30, enable_over_timeout_cb, indicator);
+ indicator->over_timeout_id = g_timeout_add (30, enable_over_timeout_cb, indicator);
g_source_set_name_by_id (indicator->over_timeout_id, "[gtk+] enable_over_timeout_cb");
}
else
_gtk_scrolled_window_get_overshoot (scrolled_window, NULL, NULL))
{
priv->scroll_events_overshoot_id =
- gdk_threads_add_timeout (50, start_scroll_deceleration_cb, scrolled_window);
+ g_timeout_add (50, start_scroll_deceleration_cb, scrolled_window);
g_source_set_name_by_id (priv->scroll_events_overshoot_id,
"[gtk+] start_scroll_deceleration_cb");
}
{
priv->timer_step = step;
priv->need_timer = TRUE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_INITIAL,
+ priv->timer = g_timeout_add (TIMEOUT_INITIAL,
(GSourceFunc) gtk_spin_button_timer,
(gpointer) spin);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
if (priv->need_timer)
{
priv->need_timer = FALSE;
- priv->timer = gdk_threads_add_timeout (TIMEOUT_REPEAT,
- (GSourceFunc) gtk_spin_button_timer,
- (gpointer) spin_button);
+ priv->timer = g_timeout_add (TIMEOUT_REPEAT,
+ (GSourceFunc) gtk_spin_button_timer,
+ spin_button);
g_source_set_name_by_id (priv->timer, "[gtk+] gtk_spin_button_timer");
}
else
if (button && !priv->switch_timer)
{
- priv->switch_timer = gdk_threads_add_timeout (TIMEOUT_EXPAND,
- gtk_stack_switcher_switch_timeout,
- self);
+ priv->switch_timer = g_timeout_add (TIMEOUT_EXPAND,
+ gtk_stack_switcher_switch_timeout,
+ self);
g_source_set_name_by_id (priv->switch_timer, "[gtk+] gtk_stack_switcher_switch_timeout");
}
}
else if (visible)
{
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
else
{
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_ON_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
priv->blink_time += get_cursor_time (text_view);
}
{
gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_OFF_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
gtk_text_view_stop_cursor_blink (text_view);
gtk_text_layout_set_cursor_visible (priv->layout, TRUE);
- priv->blink_timeout = gdk_threads_add_timeout (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
- blink_cb,
- text_view);
+ priv->blink_timeout = g_timeout_add (get_cursor_time (text_view) * CURSOR_PEND_MULTIPLIER / CURSOR_DIVIDER,
+ blink_cb,
+ text_view);
g_source_set_name_by_id (priv->blink_timeout, "[gtk+] blink_cb");
}
}
if (text_view->priv->scroll_timeout != 0) /* reset on every motion event */
g_source_remove (text_view->priv->scroll_timeout);
- text_view->priv->scroll_timeout =
- gdk_threads_add_timeout (50, selection_scan_timeout, text_view);
+ text_view->priv->scroll_timeout = g_timeout_add (50, selection_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] selection_scan_timeout");
gtk_text_view_selection_bubble_popup_unset (text_view);
if (!priv->scroll_timeout)
{
- priv->scroll_timeout =
- gdk_threads_add_timeout (100, drag_scan_timeout, text_view);
+ priv->scroll_timeout = g_timeout_add (100, drag_scan_timeout, text_view);
g_source_set_name_by_id (text_view->priv->scroll_timeout, "[gtk+] drag_scan_timeout");
}
if (priv->selection_bubble_timeout_id)
g_source_remove (priv->selection_bubble_timeout_id);
- priv->selection_bubble_timeout_id =
- gdk_threads_add_timeout (50, gtk_text_view_selection_bubble_popup_show,
- text_view);
+ priv->selection_bubble_timeout_id = g_timeout_add (50, gtk_text_view_selection_bubble_popup_show, text_view);
g_source_set_name_by_id (priv->selection_bubble_timeout_id, "[gtk+] gtk_text_view_selection_bubble_popup_cb");
}
if (!tooltip->browse_mode_timeout_id)
{
tooltip->browse_mode_timeout_id =
- gdk_threads_add_timeout_full (0, timeout,
- tooltip_browse_mode_expired,
- g_object_ref (tooltip),
- g_object_unref);
+ g_timeout_add_full (0, timeout,
+ tooltip_browse_mode_expired,
+ g_object_ref (tooltip),
+ g_object_unref);
g_source_set_name_by_id (tooltip->browse_mode_timeout_id, "[gtk+] tooltip_browse_mode_expired");
}
}
else
timeout = HOVER_TIMEOUT;
- tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout,
- tooltip_popup_timeout,
- g_object_ref (display),
- g_object_unref);
+ tooltip->timeout_id = g_timeout_add_full (0, timeout,
+ tooltip_popup_timeout,
+ g_object_ref (display),
+ g_object_unref);
g_source_set_name_by_id (tooltip->timeout_id, "[gtk+] tooltip_popup_timeout");
}
if (tree_view->priv->hover_expand)
{
tree_view->priv->auto_expand_timeout =
- gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
+ g_timeout_add (AUTO_EXPAND_TIMEOUT, auto_expand_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->auto_expand_timeout, "[gtk+] auto_expand_timeout");
}
}
{
if (tree_view->priv->scroll_timeout == 0)
{
- tree_view->priv->scroll_timeout =
- gdk_threads_add_timeout (150, scroll_row_timeout, tree_view);
+ tree_view->priv->scroll_timeout = g_timeout_add (150, scroll_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->scroll_timeout, "[gtk+] scroll_row_timeout");
}
}
pos == GTK_TREE_VIEW_DROP_INTO_OR_BEFORE))
{
tree_view->priv->open_dest_timeout =
- gdk_threads_add_timeout (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
+ g_timeout_add (AUTO_EXPAND_TIMEOUT, open_row_timeout, tree_view);
g_source_set_name_by_id (tree_view->priv->open_dest_timeout, "[gtk+] open_row_timeout");
}
else
}
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
- (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
- tree_view);
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+ tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
/* send focus-in event */
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
- (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ (GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
}
gtk_tree_view_search_enable_popdown (GtkWidget *widget,
gpointer data)
{
- guint id;
- id = gdk_threads_add_timeout_full (G_PRIORITY_HIGH, 200, gtk_tree_view_real_search_enable_popdown, g_object_ref (data), g_object_unref);
+ guint id = g_timeout_add_full (G_PRIORITY_HIGH, 200,
+ gtk_tree_view_real_search_enable_popdown,
+ g_object_ref (data),
+ g_object_unref);
g_source_set_name_by_id (id, "[gtk+] gtk_tree_view_real_search_enable_popdown");
}
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
{
g_source_remove (tree_view->priv->typeselect_flush_timeout);
tree_view->priv->typeselect_flush_timeout =
- gdk_threads_add_timeout (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
+ g_timeout_add (GTK_TREE_VIEW_SEARCH_DIALOG_TIMEOUT,
(GSourceFunc) gtk_tree_view_search_entry_flush_timeout,
tree_view);
g_source_set_name_by_id (tree_view->priv->typeselect_flush_timeout, "[gtk+] gtk_tree_view_search_entry_flush_timeout");
return;
window->priv->mnemonics_display_timeout_id =
- gdk_threads_add_timeout (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
+ g_timeout_add (MNEMONICS_DELAY, schedule_mnemonics_visible_cb, window);
g_source_set_name_by_id (window->priv->mnemonics_display_timeout_id, "[gtk+] schedule_mnemonics_visible_cb");
}
GTK_WIDGET_CLASS (gtk_inspector_misc_info_parent_class)->map (widget);
- sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1, update_info, sl);
+ sl->priv->update_source_id = g_timeout_add_seconds (1, update_info, sl);
update_info (sl);
}
if (gtk_toggle_button_get_active (button))
{
- sl->priv->update_source_id = gdk_threads_add_timeout_seconds (1,
- update_type_counts,
- sl);
+ sl->priv->update_source_id = g_timeout_add_seconds (1, update_type_counts, sl);
update_type_counts (sl);
}
else
cups_backend->list_printers_attempts = -1;
if (cups_backend->list_printers_poll > 0)
g_source_remove (cups_backend->list_printers_poll);
- cups_backend->list_printers_poll = gdk_threads_add_timeout (200,
- (GSourceFunc) cups_request_printer_list,
- cups_backend);
+ cups_backend->list_printers_poll = g_timeout_add (200, (GSourceFunc) cups_request_printer_list, cups_backend);
g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
}
else if (cups_backend->list_printers_attempts != -1)
{
if (cups_request_printer_list (cups_backend))
{
- cups_backend->list_printers_poll = gdk_threads_add_timeout (50,
- (GSourceFunc) cups_request_printer_list,
- backend);
+ cups_backend->list_printers_poll = g_timeout_add (50, (GSourceFunc) cups_request_printer_list, backend);
g_source_set_name_by_id (cups_backend->list_printers_poll, "[gtk+] cups_request_printer_list");
}
cups_printer->get_remote_ppd_attempts = -1;
if (cups_printer->get_remote_ppd_poll > 0)
g_source_remove (cups_printer->get_remote_ppd_poll);
- cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (200,
- (GSourceFunc) cups_request_ppd,
- printer);
+ cups_printer->get_remote_ppd_poll = g_timeout_add (200, (GSourceFunc) cups_request_ppd, printer);
g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
}
else if (cups_printer->get_remote_ppd_attempts != -1)
{
if (cups_request_default_printer (cups_backend))
{
- cups_backend->default_printer_poll = gdk_threads_add_timeout (200,
- (GSourceFunc) cups_request_default_printer,
- backend);
+ cups_backend->default_printer_poll = g_timeout_add (200, (GSourceFunc) cups_request_default_printer, backend);
g_source_set_name_by_id (cups_backend->default_printer_poll, "[gtk+] cups_request_default_printer");
}
}
if (cups_request_ppd (printer))
{
- cups_printer->get_remote_ppd_poll = gdk_threads_add_timeout (50,
- (GSourceFunc) cups_request_ppd,
- printer);
+ cups_printer->get_remote_ppd_poll = g_timeout_add (50, (GSourceFunc) cups_request_ppd, printer);
g_source_set_name_by_id (cups_printer->get_remote_ppd_poll, "[gtk+] cups_request_ppd");
}
}
{
gtk_assistant_set_page_complete (GTK_ASSISTANT (widget), page, FALSE);
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (page), 0.0);
- gdk_threads_add_timeout (300, (GSourceFunc) progress_timeout, widget);
+ g_timeout_add (300, (GSourceFunc) progress_timeout, widget);
}
else
g_print ("prepare: %d\n", gtk_assistant_get_current_page (GTK_ASSISTANT (widget)));
gtk_combo_box_set_active_iter (GTK_COMBO_BOX (combobox), &iter);
#if 1
- gdk_threads_add_timeout (1000, (GSourceFunc) capital_animation, model);
+ g_timeout_add (1000, (GSourceFunc) capital_animation, model);
#endif
/* Aligned Food */
{
n_animations += 20;
- timer = gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, NULL);
+ timer = g_timeout_add (1000, (GSourceFunc) animation_timer, NULL);
}
int
if (!popdown_timer)
{
g_print ("added popdown\n");
- popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
+ popdown_timer = g_timeout_add (500, popdown_cb, NULL);
}
}
}
popped_up = TRUE;
}
- popdown_timer = gdk_threads_add_timeout (500, popdown_cb, NULL);
+ popdown_timer = g_timeout_add (500, popdown_cb, NULL);
g_print ("added popdown\n");
popup_timer = FALSE;
guint time)
{
if (!popup_timer)
- popup_timer = gdk_threads_add_timeout (500, popup_cb, NULL);
+ popup_timer = g_timeout_add (500, popup_cb, NULL);
return TRUE;
}
gtk_entry_completion_set_text_column (completion, 0);
/* Fill the completion dynamically */
- gdk_threads_add_timeout (1000, (GSourceFunc) animation_timer, completion);
+ g_timeout_add (1000, (GSourceFunc) animation_timer, completion);
/* Fourth entry */
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new ("Model-less entry completion"));
{
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbutton)))
{
- guint timeout = gdk_threads_add_timeout (100,
- entry_progress_timeout,
- entry);
+ guint timeout = g_timeout_add (100, entry_progress_timeout, entry);
g_object_set_data_full (G_OBJECT (entry), "timeout-id",
GUINT_TO_POINTER (timeout),
entry_remove_timeout);
gtk_tool_button_set_label (GTK_TOOL_BUTTON (item), "Custom label");
add_item_to_list (store, item, "New");
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
- gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb, item);
+ g_timeout_add (3000, (GSourceFunc) timeout_cb, item);
gtk_tool_item_set_expand (item, TRUE);
menu = gtk_menu_new ();
gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (item), menu);
add_item_to_list (store, item, "Open");
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
- gdk_threads_add_timeout (3000, (GSourceFunc) timeout_cb1, item);
+ g_timeout_add (3000, (GSourceFunc) timeout_cb1, item);
menu = gtk_menu_new ();
for (i = 0; i < 20; i++)
g_signal_connect (button, "realize", G_CALLBACK (gtk_widget_grab_focus), NULL);
gtk_window_set_default_size (GTK_WINDOW (window), 300, 400);
gtk_widget_show (window);
- gdk_threads_add_timeout (1000, (GSourceFunc) futz, NULL);
+ g_timeout_add (1000, (GSourceFunc) futz, NULL);
gtk_main ();
return 0;
}